﻿using System;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using OfficeOpenXml.Table;

namespace NP.BPMReportPlatform.UserTrial.Dto
{
    [ExcelExporter(Name = "报表数据", TableStyle = TableStyles.Light10, AutoFitAllColumn = true)]
    public class GetCourseCertOutput
    {
        /// <summary>
        /// 培训年月
        /// </summary>
        [IEIgnore]
        public string CourseTrainUserDetailId { get; set; }

        /// <summary>
        /// 流程号
        /// </summary>
        [ExporterHeader(DisplayName = "流程号")]
        public string InstanceNumber { get; set; }

        /// <summary>
        /// 培训编码
        /// </summary>
        [ExporterHeader(DisplayName = "培训编码")]
        public string CourseTrainCode { get; set; }

        /// <summary>
        /// 参训人姓名
        /// </summary>
        [ExporterHeader(DisplayName = "参训人姓名")]
        public string TrainUser { get; set; }

        /// <summary>
        /// 参训人工号
        /// </summary>
        [ExporterHeader(DisplayName = "参训人工号")]
        public string TrainUserWorknumber { get; set; }

        /// <summary>
        /// 培训项目
        /// </summary>
        [ExporterHeader(DisplayName = "培训项目")]
        public string TraningProject { get; set; }

        /// <summary>
        /// 课程名称
        /// </summary>
        [ExporterHeader(DisplayName = "课程名称")]
        public string CourseName { get; set; }

        /// <summary>
        /// 证书截止日期
        /// </summary>
        [IEIgnore]
        public DateTime? CertEndDate { get; set; }

        /// <summary>
        /// 证书ID
        /// </summary>
        [IEIgnore]
        public string CertId { get; set; }

        /// <summary>
        /// 经办人工号
        /// </summary>
        [IEIgnore]
        public string WorkNumber { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [IEIgnore]
        public int Status { get; set; }

        /// <summary>
        /// 证书截止日期
        /// </summary>
        [ExporterHeader(DisplayName = "证书截止日期")]
        public string CertEndDateFormat
        {
            get
            {
                return this.CertEndDate?.ToString("yyyy年MM月dd日");
            }
        }

        /// <summary>
        /// 证书名称
        /// </summary>
        [ExporterHeader(DisplayName = "考证附件")]
        public string CertName { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [ExporterHeader(DisplayName = "状态")]
        public string StatusName
        {
            get
            {
                return this.Status == 1 ? "已核准" : "未核准";
            }
        }
    }
}